package ihm;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.awt.Font;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class Ajout_Specialite extends JFrame implements ActionListener 
{

	private JPanel contentPane;
	private JLabel lblNomDeLa;
	private JTextField txtSpe;
	private JButton btnValider;
	private JButton btnAnnuler;
	private JLabel lblNouvelleSpecialit;
	private JTextField txtCodeSpe;
	private JLabel lblCodeDeLa;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) 
	{
		EventQueue.invokeLater(new Runnable() 
		{
			public void run() 
			{
				try 
				{
					Ajout_Specialite frame = new Ajout_Specialite();
					frame.setVisible(true);
				} catch (Exception e) 
				{
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public Ajout_Specialite() 
	{
		setTitle("Ajout d'une sp\u00E9cialit\u00E9");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		lblNomDeLa = new JLabel("Nom de la sp\u00E9cialit\u00E9 :");
		lblNomDeLa.setBounds(22, 144, 117, 30);
		contentPane.add(lblNomDeLa);
		
		txtSpe = new JTextField();
		txtSpe.setBounds(162, 149, 86, 20);
		contentPane.add(txtSpe);
		txtSpe.setColumns(10);
		
		btnValider = new JButton("Valider");
		btnValider.setBounds(214, 213, 86, 20);
		contentPane.add(btnValider);
		
		btnAnnuler = new JButton("Annuler");
		btnAnnuler.addActionListener(this);
		btnAnnuler.setBounds(333, 211, 91, 23);
		contentPane.add(btnAnnuler);
		
		lblNouvelleSpecialit = new JLabel("Nouvelle Sp\u00E9cialit\u00E9");
		lblNouvelleSpecialit.setFont(new Font("Times New Roman", Font.BOLD | Font.ITALIC, 14));
		lblNouvelleSpecialit.setBounds(151, 24, 130, 30);
		contentPane.add(lblNouvelleSpecialit);
		
		txtCodeSpe = new JTextField();
		txtCodeSpe.setColumns(10);
		txtCodeSpe.setBounds(162, 97, 86, 20);
		contentPane.add(txtCodeSpe);
		
		lblCodeDeLa = new JLabel("Code de la sp\u00E9cialit\u00E9 :");
		lblCodeDeLa.setBounds(22, 100, 117, 14);
		contentPane.add(lblCodeDeLa);
	}
	public void actionPerformed(ActionEvent e) 
	{
		if (e.getSource() == btnAnnuler)
		{
			dispose();
		}
	}
}
